#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "NamedElement.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Constraint;
class Parameter;

/// <summary>
/// ParameterSet
/// A ParameterSet designates alternative sets of inputs or outputs that a Behavior
/// may use.
/// </summary>
class UMLMODEL_EXPORT ParameterSet : public NamedElement {

public: // Constructors and destructors
    explicit ParameterSet(const QString& umlType="uml::ParameterSet");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// conditions getter
    /// A constraint that should be satisfied for the owner of the Parameters in an
    /// input ParameterSet to start execution using the values provided for those
    /// Parameters, or the owner of the Parameters in an output ParameterSet to end
    /// execution providing the values for those Parameters, if all preconditions and
    /// conditions on input ParameterSets were satisfied.
    /// </summary>
    vector<shared_ptr<Constraint>>& conditions();

    /// <summary>
    /// parameters getter
    /// Parameters in the ParameterSet.
    /// </summary>
    vector<shared_ptr<Parameter>>& parameters();

private: // Fields
    /// <summary>
    /// conditions
    /// A constraint that should be satisfied for the owner of the Parameters in an
    /// input ParameterSet to start execution using the values provided for those
    /// Parameters, or the owner of the Parameters in an output ParameterSet to end
    /// execution providing the values for those Parameters, if all preconditions and
    /// conditions on input ParameterSets were satisfied.
    /// </summary>
    vector<shared_ptr<Constraint>> conditions_;

    /// <summary>
    /// parameters
    /// Parameters in the ParameterSet.
    /// </summary>
    vector<shared_ptr<Parameter>> parameters_;

};

} // namespace uml
